//
//  ZBMoBanFourHeadView.m
//  MoBan
//
//  Created by apple on 16/7/12.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "ZBMoBanFourtableHeadView.h"
@interface ZBMoBanFourtableHeadView()
@property(nonatomic,strong)UIImageView *Imageview;
@property(nonatomic,strong)UILabel *lable;
@property(nonatomic,strong)UILabel *locallable;
@property(nonatomic,strong)UIImageView *arrowImageview;
@end
@implementation ZBMoBanFourtableHeadView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self AddUI];
    }
    return self;
}
-(void)AddUI
{
    self.Imageview = [[UIImageView alloc]init];
    self.Imageview.image = [UIImage imageNamed:@"text.png"];
    [self addSubview:self.Imageview];
    
    
    self.locallable= [[UILabel alloc]init];
    self.locallable.text = @"济南";
    [self addSubview:self.locallable];
    
    self.lable = [[UILabel alloc]init];
    self.lable.text = @"点击登录";
    self.lable.textColor = [UIColor blackColor];
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(ZBLoginCilc)];
    self.lable.userInteractionEnabled = YES;
    [self.lable addGestureRecognizer:tap];
    [self addSubview:self.lable];
    
    self.arrowImageview = [[UIImageView alloc]init];
    UITapGestureRecognizer *arrowtap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(otherVC)];
    self.arrowImageview.userInteractionEnabled = YES;
    [self.arrowImageview addGestureRecognizer:arrowtap];
    self.arrowImageview.backgroundColor = [UIColor redColor];
    [self addSubview:self.arrowImageview];
    
}
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.Imageview.frame = CGRectMake(10*Kscr, 10*Kscr, 40*Kscr, 40*Kscr);
    self.Imageview.layer.masksToBounds = YES;
    self.Imageview.layer.cornerRadius = self.Imageview.width/2;
    

    self.lable.frame = CGRectMake(self.Imageview.right+10*Kscr, 20*Kscr, 200*Kscr, 20*Kscr);
    self.locallable.frame = CGRectMake(self.Imageview.right+10*Kscr, self.lable.bottom+3*Kscr, 40*Kscr, 20*Kscr);

    self.arrowImageview.frame=CGRectMake(self.width-30*Kscr, 20*Kscr, 13*Kscr, 20*Kscr);

}
-(void)ZBLoginCilc
{
    if ([self.deleget respondsToSelector:@selector(ZBLoginToPresentVc)]) {
        [self.deleget ZBLoginToPresentVc];
    }

}
-(void)otherVC
{
    if ([self.deleget respondsToSelector:@selector(ZBSelfMessage)]) {
        [self.deleget ZBSelfMessage];
    }
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
